package space.sakana.edusysback.mapper.cls;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import space.sakana.edusysback.entity.cls.ClsSubject;

import java.util.List;

@Mapper
public interface ClsSubjectMapper {

    @Select("select `id`, `sid`, `cid` from classsubject where `id`=#{id};")
    ClsSubject selectClsSubjectById(int id);

    @Select("select `id`, `sid`, `cid` from classsubject where `cid`=#{cid};")
    List<ClsSubject> selectClsSubjectsByCid(int cid);

    @Insert("insert into classsubject(`sid`, `cid`) values(#{sid}, #{cid});")
    int insertClsSubject(ClsSubject clsSubject);

    @Update("update classsubject set `sid`=#{sid}, `cid`=#{cid} where `id`=#{id};")
    int updateClsSubject(ClsSubject clsSubject);

}
